//
//  WKScanerCell.m
//  V-Learn
//
//  Created by Apple on 2019/6/28.
//  Copyright © 2019 yxk. All rights reserved.
//

#import "WKScanerCell.h"

@implementation WKScanerCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self setupUI];
    }
    return self;
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *identifferCell = @"WKScanerCell";
    WKScanerCell *cell = [tableView dequeueReusableCellWithIdentifier:identifferCell];
    if (!cell) {
        cell = [[WKScanerCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifferCell];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    return cell;
}
- (void)setupUI{
    
    self.titleLab = [UILabel labelWithText:@"何以繁华笙歌落" andTextColor:rgb(51,51,51) andName:nil andFontSize:15*kScaleFit];
    
    [self.contentView addSubview:self.titleLab];
    [self.titleLab makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15*kScaleFit);
        make.top.mas_equalTo(10);
        make.right.mas_equalTo(-15);
    }];
    
    self.detailLab = [UILabel labelWithText:@"回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡回答好卡嘎看个记得哈哈看啊哈卡号客户" andTextColor:rgb(102,102,102) andName:nil andFontSize:14*kScaleFit];
    self.detailLab.numberOfLines = 0;
    [self.contentView addSubview:self.detailLab];
    [self.detailLab makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15*kScaleFit);
        make.top.mas_equalTo(self.titleLab.mas_bottom).mas_equalTo(8*kScaleFit);
        make.right.mas_equalTo(-15*kScaleFit);
        make.bottom.mas_equalTo(-10*kScaleFit);
    }];
    
//    UIView *lineView = [UIView new];
//    lineView.backgroundColor = rgb(152,152,152);
//    [self.contentView addSubview:lineView];
//    [lineView makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_equalTo(15);
//        make.right.mas_equalTo(-15);
//        make.height.mas_equalTo(0.5);
//        make.bottom.mas_equalTo(0);
//    }];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
